package com.estate.service.room;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.estate.mapper.RoomMapper;
import com.estate.pojo.Room;

import net.sf.ehcache.search.expression.And;

@Service
public class RoomServiceImpl implements RoomService {
	@Autowired
	private RoomMapper roomMapper;

	@Override
	public List<Room> selectRoom(Integer projectId,String list/*, String room_number, String ban_name, String det_abbreviation,
			String project_name*/) throws Exception {
		return roomMapper.selectRoom(projectId,list);
	}

	@Override
	public Room selectRoomById(Integer roomId) throws Exception {
		return roomMapper.selectRoomById(roomId);
	}

	@Override
	public boolean updateRoomById(Room room) throws Exception {
		int number=roomMapper.updateRoomById(room);
		if(0!=number){
			return true;
		}
		return false;
	}

	@Override
	public boolean addRoom(Room room) throws Exception {
		int num = roomMapper.addRoom(room);
		if(num>0){
			return true;
		}
		return false;
	}

}
